<template>
  <div class="navba ">
    <div class="logo">
    	<router-link to="/">币万</router-link>
    </div>
    <div class="navs">
      <router-link to="/">资讯</router-link>
      <router-link v-bind="{to:'/circleOfConcern/'+2}">圈子</router-link>
    </div>
    <div class="search bar7">
      <input type="text" placeholder="     请输入关键字...">
    </div>
    <div class="regsign" v-show="!isLogin">
      <router-link to="/logins">登录</router-link>
      <span class="a">|</span>
      <router-link to="/registered">注册</router-link>
    </div>
    <div class="regsign" v-show="isLogin">
      <router-link to="/published">发布</router-link>
      <span class="a">|</span>
      <router-link to="/mysef">个人</router-link>
      <span class="a">|</span>
      <a v-on:click="logout">退出</a>
    </div>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'

  export default {
    data () {
      return {
        msg: 'Welcome to Your Vue.js App',
      }
    },
    methods: {
      logout () {
        this.$store.dispatch('logout');
        window.location.href = '/#/';
      },
    },
    computed: {
      ...mapGetters({
        isLogin: 'isLogin',
        username: 'username',
        photo: 'photo',
        token: 'token'
      })
    }
  }
</script>

<style>
  .navba {
    display: flex;
    width: 80%;
    height: 70px;
    line-height: 70px;
    margin-bottom: 4px;
    margin: 0 auto;
    background-color: #fff;
    justify-content: space-around;
    align-items: center;
  }

  .navba .logo,
  .navs,
  .regsign {
    display: inline-block;
  }

  .navba .logo {
    font-size: 24px;
    width: 74px;
    height: 40px;
    line-height: 40px;
    left: 0;
  }

  .logo a {
    display: block;
    height: 100%;
    text-indent: -9999em;
    background-image: url(../../assets/img/logo.png);
    background-repeat: no-repeat;
    background-size: 74px 40px;
    background-position: center;

  }

  /* .navba .navs{
      margin-left: 40px;
  } */

  .navba .navs a {
    display: inline-block;
    height: 100%;
    width: 40px;
    margin-left: 30px;
    color: #4290cf;
    font-size: 18px;
    text-decoration: none;
    font-family: PingFangSC-Semibold;
  }

  .navba .navs .boder-btn {
    border-bottom: 4px yellow solid;
  }

  .navba .regsign {
    float: right;
  }

  .navba .regsign a,
  .a {
    margin-left: 5px;
    font-size: 18px;
    color: #4290cf;
    text-decoration: none;
  }

  .bar7 {
    display: inline-block;
    margin-left: 20%;
  }

  .bar7 input {
    width: 200px;
    height: 33px;
    border-radius: 42px;
    padding-left: 10px;
    border: 1px solid #324B4E;
    background-color: #e5feff;
    transition: .3s linear;
    outline: none;
    background: url(../../assets/img/ss.png) no-repeat;
    background-position: 8px 8px;
    background-size: 15px;
  }

</style>
